package com.sensePlusVR.realGame;

import android.util.Log;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class SimapleAudio {
	private static final String TAG = "SimapleAudio";
	private List<String> listFiles;
	private int currentAudio;
	public SimapleAudio(){
		listFiles = new ArrayList<String>();
		currentAudio = -1;
	}
	
	public List<String> getListFiles() {
		return listFiles;
	}

	public void setListFiles(List<String> listFiles) {
		this.listFiles = listFiles;
	}
	
	public void addAudioFile(String file){
		listFiles.add(file);
	}
	
	public String getRandomAudio(){
		int size = listFiles.size();
		Random random = new Random();
		int ran = random.nextInt(size);
		if (ran == currentAudio){
			ran = (ran + 1)%listFiles.size();
		}
		currentAudio = ran;
		Log.e(TAG, "size="+listFiles.size()+" ram="+ran);
		return listFiles.get(ran);
	}
}
